package com.scse.bms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.sql.Timestamp;

/**
 * @Title: CommentDO
 * @Author: 吴赠禹
 * @Date: 2021/2/25 12:59
 * @Version: 1.0
 * @Description: 评论实体类，对应t_comment
 */

@Getter
@Setter
@ToString
@TableName("t_comment")
public class CommentDO {

    /**
     * 主键自增
     * 评论时间自动生成
     * 审核状态默认为0，待审核
     * 需添加@TableId注解，反则报异常：
     * Could not set property 'id' of 'class com.scse.bms.entity.CommentDO' with value '1365664406502920194'
     * Cause: java.lang.IllegalArgumentException: argument type mismatch
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer bookId;
    private Integer userId;
    private String content;
    private String created;
    private Integer status;


    /**
     * 以下字段非该表所有，为联合查询的字段（评论者、书名）
     */
    private String username;
    private String title;

}
